package com.aios.entity.unit;

import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;

public enum DayName {
	
	Sunday(0, "Sunday", "日",""), Monday(1, "Monday", "月",""), Tuesday(2,
			"Tuesday", "火",""), Wednesday(3, "Wednesday", "水",""), Thursday(
			4, "Thursday", "木",""), Friday(5, "Friday", "金",""), Saturday(
			6, "Saturday", "土","");

	private int dayValue;
	private String nameEn;
	private String nameJp;
	private String state;

	private DayName(int dayValue, String nameEn, String nameJp, String state) {
		this.dayValue = dayValue;
		this.nameEn = nameEn;
		this.nameJp = nameJp;
		this.state=state;

	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public int getDayValue() {
		return dayValue;
	}

	public void setDayValue(int dayValue) {
		this.dayValue = dayValue;
	}

	public String getNameEn() {
		return nameEn;
	}

	public void setNameEn(String nameEn) {
		this.nameEn = nameEn;
	}

	public String getNameJp() {
		return nameJp;
	}

	public void setNameJp(String nameJp) {
		this.nameJp = nameJp;
	}
	
	public static Map<Integer, String> getMap(Locale locale) {
		
		Map<Integer, String> map = new TreeMap<Integer, String>();
		
		for(DayName dn: values()) {
			if(locale.equals(Locale.JAPAN) || locale.equals(Locale.JAPANESE)) {
				map.put(dn.dayValue, dn.nameJp);
			} else {
				map.put(dn.dayValue, dn.nameEn);
			}
		}
		
		return map;
	}

}
